package com.ruoyi.system.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.TestSysDept666;
import com.ruoyi.system.service.ITestSysDept666Service;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 风机表666Controller
 * 
 * @author ruoyi
 * @date 2025-08-19
 */
@RestController
@RequestMapping("/system/test_sys_dept666")
public class TestSysDept666Controller extends BaseController
{
    @Autowired
    private ITestSysDept666Service testSysDept666Service;

    /**
     * 查询风机表666列表
     */
    @PreAuthorize("@ss.hasPermi('system:test_sys_dept666:list')")
    @GetMapping("/list")
    public TableDataInfo list(TestSysDept666 testSysDept666)
    {
        startPage();
        List<TestSysDept666> list = testSysDept666Service.selectTestSysDept666List(testSysDept666);
        return getDataTable(list);
    }

    /**
     * 导出风机表666列表
     */
    @PreAuthorize("@ss.hasPermi('system:test_sys_dept666:export')")
    @Log(title = "风机表666", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TestSysDept666 testSysDept666)
    {
        List<TestSysDept666> list = testSysDept666Service.selectTestSysDept666List(testSysDept666);
        ExcelUtil<TestSysDept666> util = new ExcelUtil<TestSysDept666>(TestSysDept666.class);
        util.exportExcel(response, list, "风机表666数据");
    }

    /**
     * 获取风机表666详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:test_sys_dept666:query')")
    @GetMapping(value = "/{deptId}")
    public AjaxResult getInfo(@PathVariable("deptId") Integer deptId)
    {
        return success(testSysDept666Service.selectTestSysDept666ByDeptId(deptId));
    }

    /**
     * 新增风机表666
     */
    @PreAuthorize("@ss.hasPermi('system:test_sys_dept666:add')")
    @Log(title = "风机表666", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TestSysDept666 testSysDept666)
    {
        return toAjax(testSysDept666Service.insertTestSysDept666(testSysDept666));
    }

    /**
     * 修改风机表666
     */
    @PreAuthorize("@ss.hasPermi('system:test_sys_dept666:edit')")
    @Log(title = "风机表666", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TestSysDept666 testSysDept666)
    {
        return toAjax(testSysDept666Service.updateTestSysDept666(testSysDept666));
    }

    /**
     * 删除风机表666
     */
    @PreAuthorize("@ss.hasPermi('system:test_sys_dept666:remove')")
    @Log(title = "风机表666", businessType = BusinessType.DELETE)
	@DeleteMapping("/{deptIds}")
    public AjaxResult remove(@PathVariable Integer[] deptIds)
    {
        return toAjax(testSysDept666Service.deleteTestSysDept666ByDeptIds(deptIds));
    }
}
